<?php
    // Измерение времени выполнения скрипта
    $mtime = microtime(); 
    $mtime = explode(" ",$mtime); 
    $mtime = $mtime[1] + $mtime[0]; 
    $tstart = $mtime;
    ob_start('ob_gzhandler');
    include('inc/php/core/config.php');
    include('inc/php/core/functions.php');

    session_start();
    // http://annimon.com/code/?act=view&id=2566
    foreach ($_POST as $inx => $val) {
        $_POST[$inx] = htmlspecialchars($_POST[$inx]);
        if (!ini_get(magic_quotes_gpc))
          $_POST[$inx] = addslashes($_POST[$inx]);
    }
    foreach ($_GET as $inx => $val) {
        $_GET[$inx] = htmlspecialchars($_GET[$inx]);
        if (!ini_get(magic_quotes_gpc))
          $_GET[$inx] = addslashes($_GET[$inx]);
    }
    foreach ($_COOKIE as $inx => $val) {
        $_COOKIE[$inx] = htmlspecialchars($_COOKIE[$inx]);
        if (!ini_get(magic_quotes_gpc))
          $_COOKIE[$inx] = addslashes($_COOKIE[$inx]);
    }

    // Если предположить, что в $_GET['id'] всегда целое число
    if (isset($_GET['id'])) {
        $_GET['id'] = (int)$_GET['id'];
    }

    @ini_set('arg_separator.output', '&amp;');
    @ini_set('session.use_only_cookies', 0);
    
    include('inc/php/core/traits/browser.php');
    include('inc/php/core/traits/data.php');
    include('inc/php/core/traits/face.php');
    include('inc/php/core/traits/pagination.php');
    include('inc/php/core/traits/rights.php');

    function __autoload($classname)
    {
        include('inc/php/core/classes/'.$classname.'.php');
    }
    function class_loading_error($classname)
    {
        echo 'Can\nt load '.$classname.' class<br>';
    }
    $article =    new Article()    or die(class_loading_error('article'));
    // $db =         new Db()         or die(class_loading_error('db'));
    // $db =         Db::singleton();
    $db =         new Lpdo($config['Database']);
    $core =       new Core()       or die(class_loading_error('core'));
    $forum =      new Forum()      or die(class_loading_error('forum'));
    $gallery =    new Gallery()    or die(class_loading_error('gallery'));
    $gb =         new Gb()         or die(class_loading_error('gb'));
    $mail =       new Mail()       or die(class_loading_error('mail')); 
    $page =       new Page()       or die(class_loading_error('page')); 
    $statistics = new Statistics() or die(class_loading_error('statistics'));
    $user =       new User()       or die(class_loading_error('user'));
   
    $statistics->addRecord($user);
?>
